import json

import scrapy

# scrapy提取ajax数据


class TSpider(scrapy.Spider):
    name = 't'
    # allowed_domains = ['toutiao.com']
    # start_urls = ['https://www.toutiao.com/api/search/content/?aid=24&app_name=web_search&offset=0&format=json&keyword=街拍']
    start_urls = ['https://www.baidu.com','https://www.toutiao.com']

    def parse(self, response):
        # resp = json.loads(response.body)
        # # print(resp)
        # for item in resp["data"]:
        #     print(item)
        print(response.url)
